<?php
$form = $this->beginWidget('CActiveForm', array(
    'id' => 'cms-form',
    'enableAjaxValidation' => false,
    'enableClientValidation' => true,
    'htmlOptions' => array(
        'class' => 'form-horizontal',
    ),
        ));
?>


<?php $Alllanguage = MyFunctionCustom::getLanguage();   if(count($Alllanguage)>0): ?>
<div class="tabbable">
            <?php $i=1; ?>
            <ul id="myTab" class="nav nav-tabs">
                   <?php foreach ($Alllanguage as $klang=>$lang):?>
                    <li <?php if($i==1) echo 'class="active"' ?> >
                            <a href="#tab_<?php echo $klang; ?>" data-toggle="tab"><?php echo $lang ?> </a>
                    </li>
                    <?php $i++;endforeach; ?>
            </ul>
    
    
    
            <div class="tab-content">
                                      <div class="control-group">
                                          <?php echo $form->labelEx($model, "page_type", array('class' => 'control-label')); ?>
                                      <div class="controls">
                                          <?php echo $form->dropdownlist($model, "page_type",  MyFunctionCustom::getPagetype()); ?>
                                          <span class="help-inline"><?php echo $form->error($model, 'page_type'); ?></span>
                                      </div>
                                  </div>            
                
                
                    <?php  $i=1;?>
                    <?php foreach ($Alllanguage as $key=>$language):?>
                    <div class="tab-pane <?php if($i==1) echo 'active' ?>"  id="tab_<?php echo $key; ?>">
         
                            <div class="row-fluid">
                              <div class="span12">
                                  <!--PAGE CONTENT BEGINS-->

                                  <div class="control-group">
                                          <?php echo $form->labelEx($model, "name", array('class' => 'control-label')); ?>
                                      <div class="controls">
                                          <?php echo $form->textField($model, "name[$key]", array('class' => 'span6', 'size' => 60, 'maxlength' => 255)); ?>
                                          <span class="help-inline"><?php echo $form->error($model, 'name'); ?></span>
                                      </div>
                                  </div>

                                  
                                  <div class="control-group" >
                                      <?php echo $form->labelEx($model, 'description', array('class' => 'control-label')); ?>
                                      <div class="controls">
                                          <span class="help-inline"><?php echo $form->error($model, 'description'); ?></span>
                                      </div>
                                  </div>       
                                                  <?php
                                                      $this->widget('ext.editMe.ExtEditMe', array(
//                                                          'name' => 'Cms[description_'.$key .']',
                                                          'id' => 'description_'.$key ,
                                                          'height' => '250px',
                                                          'width' => '100%',
                                                          'model'=>$model,
                                                          'attribute' => "description[$key]",
                                                          'toolbar' => Yii::app()->params['ckeditor'],
                                                          'filebrowserBrowseUrl' => Yii::app()->baseUrl . '/ckfinder/ckfinder.html',
                                                          'filebrowserImageBrowseUrl' => Yii::app()->baseUrl . '/ckfinder/ckfinder.html?type=Images',
                                                          'filebrowserFlashBrowseUrl' => Yii::app()->baseUrl . '/ckfinder/ckfinder.html?type=Flash',
                                                          'filebrowserUploadUrl' => Yii::app()->baseUrl . '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files',
                                                          'filebrowserImageUploadUrl' => Yii::app()->baseUrl . '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images',
                                                          'filebrowserFlashUploadUrl' => Yii::app()->baseUrl . '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash',
                                                      ));
                                                  ?>   
                                  <div class="clear"></div>


                                  <div class="form-actions">
                                      <button class="btn btn-info" type="submit">
                                          <i class="icon-ok bigger-110"></i>
                                          Submit
                                      </button>
                                  </div>
                                  <!--PAGE CONTENT ENDS-->
                              </div><!--/.span-->
                          </div><!--/.row-fluid-->                      
                        
                        
                        
                        
                    </div>
                   <?php $i++;endforeach; ?>
            </div>
    </div>


<?php endif; ?>
<?php $this->endWidget(); ?>